#include <iostream>
using namespace std;

/**
 * 输入一行字符，统计其中字母、空格、数字和其他字符的个数
 */
int main(int argc, char const *argv[])
{
    char import = ' ';
    char a = ' ';
    cout << "请输入"<<endl;

    int letter = 0;
    int blank = 0;
    int figure = 0;
    int characters = 0;

    while(1)
    {
        cin >> import;
        cout << import <<" ";
        cout <<endl;
        if(import >= 65 && import <= 90)
        {
            letter += 1;
        }
        else if(import >= 97 && import <= 122)
        {
            letter += 1;
        }
        else if(a == import)
        {
            blank += 1;
        }
        else if(import >= 48 && import <= 57)
        {
            figure += 1;
        }
        else 
            characters += 1;
        
        cout << "字母个数为："<< letter << endl
                << "空格个数为：" << blank << endl
                << "数字个数为："<< figure << endl
                << "其他字符个数为：" << characters << endl;
    }
    return 0;
}
